home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / mail-tools / thor / thor_2.22 / thor.lha / rexx / ShowEvent.thor < prev    next >
Text File  |  1995-12-18  |  1KB  |  76 lines

  1. /*
  2.  $VER: ShowEvent.thor 1.0 by Remco van Hooff
  3.  
  4.  Shows the current event in the main window.
  5. */
  6. /*trace results*/
  7.  
  8. p = address show('P')
  9. thorport = pos('THOR.',p)
  10. if thorport > 0 then thorport = word(substr(p,thorport),1)
  11. else do
  12.   say 'THOR port not found!'
  13.   exit
  14. end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.   address command
  18.     "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  19.     "WaitForPort BBSREAD"
  20. end
  21.  
  22. address(thorport)
  23. options results
  24.  
  25. GETSELECTEDEVENT
  26. if rc = 5 then do
  27.   REQUESTNOTIFY TEXT '"The events window is not open."' BT '"_Ok"'
  28.   exit
  29. end
  30. if rc = 30 then do
  31.   REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  32.   exit
  33. end
  34. event = result
  35.  
  36. CURRENTSYSTEM stem CURRENT
  37. if(rc ~= 0) then do
  38.   REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  39.   exit
  40. end
  41. bbs = '"'CURRENT.BBSNAME'"'
  42.  
  43. address BBSREAD
  44. GETBBSDATA bbsname bbs stem DATA
  45. if(rc ~= 0) then do
  46.   address(thorport)
  47.   REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  48.   exit
  49. end
  50. path = DATA.BBSPATH
  51. fevent = DATA.FIRSTEVENT
  52. levent = DATA.LASTEVENT
  53. if fevent > levent then do
  54.   address(thorport)
  55.   REQUESTNOTIFY TEXT '"No event found."' BT '"_Ok"'
  56.   exit
  57. end
  58.  
  59.  
  60. READBREVENT bbsname bbs eventnr event tagsstem TAG
  61. if(rc ~= 0) then do
  62.   address(thorport)
  63.   REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  64.   exit
  65. end
  66. msg = path||TAG.MSGFILE
  67.  
  68. address(thorport)
  69. SHOWTEXT file msg
  70. if(rc ~= 0) then do
  71.   REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  72.   exit
  73. end
  74.  
  75. exit
  76.